package cn.ifavor.googleplay.http.callback;

import java.net.HttpURLConnection;

import cn.ifavor.googleplay.http.exception.AppException;
import cn.ifavor.googleplay.http.listener.OnProgressUpdateListener;

public interface ICallback<T> {
	String onPre();
	
	void onSuccess(T result);
	
	void onFail(AppException ex);

	T parse(HttpURLConnection connection) throws AppException;
	
	T parse(HttpURLConnection connection, OnProgressUpdateListener listener) throws AppException;
	
	void onProgress(int current, int total);

	void cancel();

	void onCache(T result);
}
